[#756] Reader holdings: replace inline stats with 4-box grid#760
[#756] Reader holdings: replace inline stats with 4-box grid#760realproject7 merged 2 commits intomainfrom
Conversation
Replaces inline label-value text (Balance, Price, Entry, Traded) with a 2×2 stat-box grid matching the Writer tab pattern: - Value: USD with 24h % change (colored green/red) - Balance: compact K/M format via formatCompact helper - PnL: USD profit/loss with % (or dash if no entry price) - First Traded: full date with year from first mint timestamp Also adds firstTraded field to PortfolioHolding interface, derived from the existing first-mint query. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
project7-interns
left a comment
There was a problem hiding this comment.
T2b APPROVE
Good restructure from inline stats to 2×2 grid. Review notes:
formatCompacthelper is clean and handles edge cases (M/K/raw)reserveDecimalscorrectly used for value formatting; token balance uses hardcoded 18 (pre-existing pattern)- PnL calculation logic is correct:
(current - entry) * balance * plotUsdwith proper fallback to "—" firstTradedefficiently reuses the existingfirstMintquery- Grid layout with
grid-cols-2 gap-2should work well at 375px
No concerns.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The new 2x2 holdings grid is close, but two parts of the implementation do not match the requested behavior for issue #756.
Findings
- [medium] The new Value box still falls back to a PLOT-denominated string when
plotUsdis unavailable, even though the ticket explicitly requires USD-only display for this field.- File:
src/app/profile/[address]/page.tsx:1513 - Suggestion: Render
—or a loading placeholder untilplotUsdis available instead of falling back to${formatPrice(...)} ${RESERVE_LABEL}.
- File:
- [medium]
First Tradedis currently derived from the user's firstmintonly, so readers who first acquired a token via a non-mint trade will incorrectly see—even when they do have trade history.- File:
src/app/profile/[address]/page.tsx:1307 - Suggestion: Query the earliest trade for that user/storyline without restricting to
event_type = "mint"; keep the entry-price logic separate if it still needs first-mint semantics.
- File:
Decision
Requesting changes because the current implementation can show the wrong Value format and can leave First Traded blank for valid reader holdings.
…trade type - Value box now shows "—" instead of PLOT when USD price unavailable - First Traded derives from any trade type (not just mints), so readers who acquired via transfer are covered Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The follow-up commit addresses both review findings: the Value box no longer falls back to a PLOT-denominated display, and First Traded now comes from the earliest trade regardless of event type.
Findings
- None.
Decision
Approving because the Reader holdings 2x2 grid now matches the requested issue #756 behavior and the previously reported correctness gaps are resolved.
Summary
formatCompacthelper andfirstTradedfield toPortfolioHoldingFixes #756
Test plan
npm run buildpasses🤖 Generated with Claude Code